<form method="post" id="form_vacabulary_add">
  <table class="itable itable-color">
    <tr>
      <td width="80px"></td>
      <td id="msg_add"></td>
    </tr>
    <tr>
      <td width="80px">名称</td>
      <td><input type="text" value="" name="name"/></td>
    </tr>
    <tr>
      <td>机读名称</td>
      <td><input type="text" value="" name="machine_name"/></td>
    </tr>
    <tr>
      <td>描述</td>
      <td><textarea name="description"></textarea></td>
    </tr>
    <tr>
      <td>排序</td>
      <td><input type="text" value="0" name="weight"/></td>
    </tr>
    <tr>
      <td></td>
      <td><input type="submit" name="submit" value="确认添加" />
      <input id="reset" type="reset" value="清空" style="display:none;"/></td>
    </tr>
  </table>
</form>

<script type="text/javascript">
$("#form_vacabulary_add").submit(function(){
	$.ajax({
		type: "POST",
		url: "admin.php?ctrl=taxonomy&act=vocabulary_submit",
		data: $(this).serialize(),
		timeout: 20000,
		error: function(){alert('error');},
		success: function(result){
		  if(result == 'success'){
			  $('#reset').trigger('click');
			  $('#msg_add').html('添加成功');
		  }else{
			  $('#msg_add').html(result);
		  }
		}
	});
	return false;
});
</script>
